package com.github.icloudpay.crm.core.rest;

import java.util.Map;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.github.icloudpay.crm.core.biz.PersonalAccountBiz;
import com.github.icloudpay.crm.core.entity.PersonalAccount;
import com.github.wxiaoqi.security.common.rest.BaseController;



/**
 * 个人账户
 * @author Administrator
 *
 */
@Controller
@RequestMapping("admin/personalAccount")
public class PersonalAccountController extends BaseController<PersonalAccountBiz,PersonalAccount> {
	
	private static final Logger logger = LoggerFactory.getLogger(PersonalAccountController.class); 
	
	@Autowired
	private PersonalAccountBiz personalAccountBiz;
	
	
	/**
	 * 查询个人账户
	 * @param map
	 * @return
	 */
	@ResponseBody
	@RequestMapping(value = "/getPersonalAccount", method = RequestMethod.POST)
	public Map<String, Object> getPersonalAccount(Map<String, Object> map) {
		logger.info("查询个人账户，请求参数。。。{}"+map);
		Map<String, Object> resp = personalAccountBiz.queryPersonalAccounts(map);
		logger.info("查询个人账户，响应参数。。。{}"+resp);
		return resp;
	}
	
	
	/**
	 * 冻结个人账户
	 * @param map
	 * @return
	 */
	@ResponseBody
	@RequestMapping(value = "/freezePersonalAccount", method = RequestMethod.POST)
	public Map<String, Object> freezePersonalAccount(Map<String, Object> map) {
		logger.info("冻结个人账户，请求参数。。。{}"+map);
		Map<String, Object> resp = personalAccountBiz.updateAccountStatus(map);
		logger.info("冻结个人账户，响应参数。。。{}"+resp);
		return resp;
	}
	
	
	/**
	 * 导出个人账户表
	 * @param map
	 * @return
	 */
	@ResponseBody
	@RequestMapping(value = "/exportPersonalAccount", method = RequestMethod.POST)
	public void exportPersonalAccount(Map<String, Object> map) {
		logger.info("导出个人账户表，请求参数。。。{}"+map);
		Map<String, Object> resp = personalAccountBiz.queryPersonalAccounts(map);


	}

}